<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/function.asp"-->
<!--#include file="../common/admin.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>main</title>
<link href="../css/style.css" rel="stylesheet" type="text/css"/>
<style>body {background-color: #eaece1;}</style>
</head>

<body>
<div class="main">
  <div class="main-title">等待出价商品</div>
  <div class="main-content">
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="tab">
    <tr>
      <td align="center" bgcolor="#FFFFFF"><strong>卖家ID</strong></td>
      <td align="center" bgcolor="#FFFFFF"><strong>标号</strong></td>
      <td colspan="2" align="center" bgcolor="#FFFFFF"><strong><span class="items">商品</span></strong></td>
      <td align="center" bgcolor="#FFFFFF"><strong><span class="items">剩余时间</span></strong></td>
      <td align="center" bgcolor="#FFFFFF"><strong>价格</strong></td>
      <td align="center" bgcolor="#FFFFFF"><strong>雅虎出价状态</strong></td>
      <td align="center" bgcolor="#FFFFFF"><strong>保证金</strong></td>
      <td align="center" bgcolor="#FFFFFF"><strong>类型</strong></td>
      <td align="center" bgcolor="#FFFFFF"><strong>会员</strong></td>
      <td bgcolor="#FFFFFF"><strong>添加时间</strong></td>
      </tr>
                      <%			
					  set rs=server.CreateObject("adodb.recordset")
			          sql="select * from AuctionsOrder where datediff(minute,'"&now()&"',endtime)<10 and BidsPrice>=price and bidmark=1 order by endtime asc"
			          rs.open sql,conn,1,3
					  if rs.eof then
					  response.Write "<tr><td colspan=""11"" align=""center"" bgcolor=""#FFFFFF"">暂无</td></tr>"
					  end if
			          if not rs.eof then
			          do while not rs.eof 

					  '系统出价
					  keypostdatastrx="auctionUrl="&replace(rs("url"),"http://","")&"&big="&rs("BidsPrice")&"&cookie="&server.urlencode(replace(web_cookie,"=","zibolan"))&"&rp=zibolan"
					  keytopurlx=web_bidsUrl&"?"
					  keyREST_RESPONSEtt=getHTTPPage(keytopurlx&keypostdatastrx)
					  
					  rs("bidmark")=2
					  %>
    <tr>
      <td align="center" bgcolor="#FFFFFF"><a target="_blank" href="http://store.auctions.yahoo.co.jp/html/profile/<%=rs("SellerID")%>.html"><%=rs("SellerID")%></a> <a target="_blank" href="http://rating.auctions.yahoo.co.jp/jp/show/rating?userID=<%=rs("SellerID")%>">评价</a></td>
      <td align="center" bgcolor="#FFFFFF"><%=rs("Itemnumber")%></td>
      <td bgcolor="#FFFFFF"><a title="进入本站查看" target="_blank" href="/auctions/<%=rs("Itemnumber")%>.html?s=t"><img src="<%=rs("pic")%>" height="50" /></a></td>
      <td bgcolor="#FFFFFF"><a title="进入雅虎查看" target="_blank" href="<%=rs("url")%>"><%=left(rs("title"),15)%></a></td>
      <td align="center" bgcolor="#FFFFFF"><%if rs("endtime")<now() then%>
        <strong>已结束</strong>
        <%else%>
        <span class="strong" id="spanMkshy<%=rs("id")%>" ></span><SCRIPT language=javascript>
<!--
function showMkshy<%=rs("id")%>(){
window.setTimeout("showMkshy<%=rs("id")%>()", 1000);
BirthDay=new Date("<%=replace(rs("endtime"),"-","/")%>");//改成你的计时日期
today=new Date();
timeold=(BirthDay.getTime()-today.getTime());
sectimeold=timeold/1000
secondsold=Math.floor(sectimeold);
msPerDay=24*60*60*1000
e_daysold=timeold/msPerDay
daysold=Math.floor(e_daysold);
e_hrsold=(e_daysold-daysold)*24;
hrsold=Math.floor(e_hrsold);
e_minsold=(e_hrsold-hrsold)*60;
minsold=Math.floor((e_hrsold-hrsold)*60);
seconds=Math.floor((e_minsold-minsold)*60);
//spanMkshy.innerHTML=daysold+"天"+hrsold+"时"+minsold+"分"+seconds+"秒" ;
document.getElementById("spanMkshy<%=rs("id")%>").innerHTML=daysold+"天"+hrsold+"时"+minsold+"分"+seconds+"秒" ;
}
showMkshy<%=rs("id")%>();
//-->
</SCRIPT>
        <%end if%> </td>
      <td align="center" bgcolor="#FFFFFF">
        <%=rs("BidsPrice")%>日元 | <%=cdbl(rs("BidsPrice"))*web_rate%> RMB 出价 <br />
        <%=rs("price")%>日元 | <%=cdbl(rs("price"))*web_rate%> RMB 当前
        </td>
      <td align="center" bgcolor="#FFFFFF"><%
		  select case rs("bidmark")
		  case 0: response.write("<font color='red'>出价失败</font>")
		  case 1: response.write("未出价")
		  case 2: response.write("已出价")
	      end select
		  %></td>
      <td align="center" bgcolor="#FFFFFF"><%=rs("bail")%>RMB</td>
      <td align="center" bgcolor="#FFFFFF"><%if rs("type")="0" then response.Write "出价竞拍" else response.Write "预约出价"%></td>
      <td align="center" bgcolor="#FFFFFF"><%set rss=conn.execute("select mail from [user] where uid='"&rs("uid")&"'")
		                               if not rss.eof then
		                               response.write rss("mail")
									   end if
									   set rss=nothing%></td>
      <td bgcolor="#FFFFFF"><%=rs("addtime")%></td>
      </tr>
                      
                     
	    	          <%
					  rs.movenext
			          loop
			          rs.close
			          set rs=nothing
			          end if		 
				      %>
    <tr>
      <td colspan="11" align="center" bgcolor="#FFFFFF" class="page">
        </td>
      </tr>
  </table>
</div>
</div>




<div class="main">
  <div class="main-title">出价被超商品更新</div>
  <div class="main-content">
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="tab">
    <tr>
      <td align="center" bgcolor="#FFFFFF"><strong>卖家ID</strong></td>
      <td align="center" bgcolor="#FFFFFF"><strong>标号</strong></td>
      <td colspan="2" align="center" bgcolor="#FFFFFF"><strong><span class="items">商品</span></strong></td>
      <td align="center" bgcolor="#FFFFFF"><strong><span class="items">剩余时间</span></strong></td>
      <td align="center" bgcolor="#FFFFFF"><strong>价格</strong></td>
      <td align="center" bgcolor="#FFFFFF"><strong>雅虎出价状态</strong></td>
      <td align="center" bgcolor="#FFFFFF"><strong>保证金</strong></td>
      <td align="center" bgcolor="#FFFFFF"><strong>类型</strong></td>
      <td align="center" bgcolor="#FFFFFF"><strong>会员</strong></td>
      <td bgcolor="#FFFFFF"><strong>添加时间</strong></td>
      </tr>
                      <%			
					  set rs=server.CreateObject("adodb.recordset")
			          sql="select * from AuctionsOrder where datediff(minute,'"&now()&"',endtime)>0 and datediff(minute,'"&now()&"',endtime)<1440 order by endtime asc"
			          rs.open sql,conn,1,3
					  if rs.eof then
					  response.Write "<tr><td colspan=""11"" align=""center"" bgcolor=""#FFFFFF"">暂无</td></tr>"
					  end if
			          if not rs.eof then
			          do while not rs.eof 

					  '获取最新价格
					  responsegroup="large"
					  image_size=600
					  topurl="http://auctions.yahooapis.jp/AuctionWebService/V2/auctionItem?"'正式接口
					  postdatastr="appid="&yahoo_daigou_apiid&"&responsegroup="&responsegroup&"&auctionID="&rs("Itemnumber")&"&image_size="&image_size&""
					  REST_RESPONSEhot=getHTTPPage(topurl&postdatastr) 

					  Set xml=Server.CreateObject("Microsoft.XMLDOM")
					  xml.Async=False 
					  xml.ValidateOnParse=False 
					  xml.LoadXml(REST_RESPONSEhot) 
					  Set item = xml.selectNodes("ResultSet")
					  For i = 0 To iLength
					  Set oXMLItem = item.item(i)
					  totalResultsAvailable=oXMLItem.getAttribute("totalResultsReturned")
					  Next
					  
					  if totalResultsAvailable="1" then
						Set item=xml.getElementsByTagName("Result") 
						For a=0 To (item.Length-1) 
					   
						'商品现在价格 
						Set Price=item.Item(a).getElementsByTagName("Price") 
						set PriceNode = item.Item(a).selectSingleNode("Price")  
						if Not PriceNode is Nothing Then Price=Price.Item(0).Text else Price="" 
					   
					    rs("price")=price
					   
						next 
					  end if 
					  %>
    <tr>
      <td align="center" bgcolor="#FFFFFF"><a target="_blank" href="http://store.auctions.yahoo.co.jp/html/profile/<%=rs("SellerID")%>.html"><%=rs("SellerID")%></a> <a target="_blank" href="http://rating.auctions.yahoo.co.jp/jp/show/rating?userID=<%=rs("SellerID")%>">评价</a></td>
      <td align="center" bgcolor="#FFFFFF"><%=rs("Itemnumber")%></td>
      <td bgcolor="#FFFFFF"><a title="进入本站查看" target="_blank" href="/auctions/<%=rs("Itemnumber")%>.html?s=t"><img src="<%=rs("pic")%>" height="50" /></a></td>
      <td bgcolor="#FFFFFF"><a title="进入雅虎查看" target="_blank" href="<%=rs("url")%>"><%=left(rs("title"),15)%></a></td>
      <td align="center" bgcolor="#FFFFFF"><%if rs("endtime")<now() then%>
        <strong>已结束</strong>
        <%else%>
        <span class="strong" id="spanMkshy<%=rs("id")%>" ></span><SCRIPT language=javascript>
<!--
function showMkshy<%=rs("id")%>(){
window.setTimeout("showMkshy<%=rs("id")%>()", 1000);
BirthDay=new Date("<%=replace(rs("endtime"),"-","/")%>");//改成你的计时日期
today=new Date();
timeold=(BirthDay.getTime()-today.getTime());
sectimeold=timeold/1000
secondsold=Math.floor(sectimeold);
msPerDay=24*60*60*1000
e_daysold=timeold/msPerDay
daysold=Math.floor(e_daysold);
e_hrsold=(e_daysold-daysold)*24;
hrsold=Math.floor(e_hrsold);
e_minsold=(e_hrsold-hrsold)*60;
minsold=Math.floor((e_hrsold-hrsold)*60);
seconds=Math.floor((e_minsold-minsold)*60);
//spanMkshy.innerHTML=daysold+"天"+hrsold+"时"+minsold+"分"+seconds+"秒" ;
document.getElementById("spanMkshy<%=rs("id")%>").innerHTML=daysold+"天"+hrsold+"时"+minsold+"分"+seconds+"秒" ;
}
showMkshy<%=rs("id")%>();
//-->
</SCRIPT>
        <%end if%> </td>
      <td align="center" bgcolor="#FFFFFF">
        <%=rs("BidsPrice")%>日元 | <%=cdbl(rs("BidsPrice"))*web_rate%> RMB 出价 <br />
        <%=rs("price")%>日元 | <%=cdbl(rs("price"))*web_rate%> RMB 当前
        </td>
      <td align="center" bgcolor="#FFFFFF"><%
		  select case rs("bidmark")
		  case 0: response.write("<font color='red'>出价失败</font>")
		  case 1: response.write("未出价")
		  case 2: response.write("已出价")
	      end select
		  %></td>
      <td align="center" bgcolor="#FFFFFF"><%=rs("bail")%>RMB</td>
      <td align="center" bgcolor="#FFFFFF"><%if rs("type")="0" then response.Write "出价竞拍" else response.Write "预约出价"%></td>
      <td align="center" bgcolor="#FFFFFF"><%set rss=conn.execute("select mail from [user] where uid='"&rs("uid")&"'")
		                               if not rss.eof then
		                               response.write rss("mail")
									   end if
									   set rss=nothing%></td>
      <td bgcolor="#FFFFFF"><%=rs("addtime")%></td>
      </tr>
                      
                     
	    	          <%
					  rs.movenext
			          loop
			          rs.close
			          set rs=nothing
			          end if		 
				      %>
    <tr>
      <td colspan="11" align="center" bgcolor="#FFFFFF" class="page">
        </td>
      </tr>
  </table>
</div>
</div>
<script type="text/javascript">setTimeout('window.location.replace(location.href)', 50000);</script>
</body>
</html>